#include "NGraph.h"

namespace nflt {

	template <typename T, unsigned int N>
	NNMap<T,N>::NNMap(void)
	{}

	template <typename T, unsigned int N>
	NNMap<T,N>::~NNMap(void)
	{}



	/////////////////////////////
	template <typename T>
	NNMap<T,1>::NNMap(void)
	{}

	template <typename T>
	NNMap<T,1>::~NNMap(void)
	{}

	template <typename T>
	index_list& NNMap<T,1>::operator[](const T& key) {
		nmap_container::iterator i = map_.find(key);
		if (i == map_.end()) {
			pair<nmap_container::iterator, bool> result = map_.insert(nmap_container::value_type(key, index_list() ));
			
			if (result.second == false)
				throw bad_alloc();
			else
				return result.first->second;
		}
		return i->second;
	}

}